Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: Add ESM support #437

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

olexandr-mazepa
Copy link
Collaborator

@olexandr-mazepa olexandr-mazepa commented Feb 11, 2025

BREAKING:

  • Exports of TypeScript types, interfaces, and enums have been moved to the mailgun.js/definitions submodule.
    In case you need them, starting from version 12, please use

    import { MailgunClientOptions, MessagesSendResult } from 'mailgun.js/definitions';

    instead of

    import { MailgunClientOptions, MessagesSendResult } from 'mailgun.js';
  • AMD import no longer requires using the .default property.
    So now this is

    <script>
    require('./dist/AMD/mailgun.amd.js', function(Mailgun) {
     const mailgun = new Mailgun(FormData); // default property is not needed anymore
    }
    </script>

    Instead of

    <script>
    require('./dist/AMD/mailgun.amd.js', function(Mailgun) {
     const mailgun = new Mailgun.default(FormData);  // default property was required previously
    });
    </script>

Features:

  • Added ESM bundles for browser and Node.js environments

Other:

  • Webpack has been replaced by Rollup
  • Mocha has been replaced by Jest to use one test runner for all tests
  • Added new tests that check ESM bundles exports
  • Updated TS documentation

@olexandr-mazepa olexandr-mazepa changed the title breaking: Move types, interfaces, enums into submodule breaking: Add esm support Feb 12, 2025
@olexandr-mazepa olexandr-mazepa changed the title breaking: Add esm support breaking: Add ESM support Feb 12, 2025
@olexandr-mazepa olexandr-mazepa force-pushed the replace-webpack-by-roll-up branch from 37704b1 to 03ee42c Compare February 14, 2025 16:21
@olexandr-mazepa olexandr-mazepa force-pushed the replace-webpack-by-roll-up branch from 64c66e0 to e658740 Compare February 18, 2025 11:23
@olexandr-mazepa olexandr-mazepa marked this pull request as ready for review February 19, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant